home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / STRLEN.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  598b  |  46 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; strlen- Computes the length of the string which ES:DI points at.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI- Points at string to compute the length of.
  14. ;
  15. ; output:
  16. ;
  17. ;    CX- Length of string.
  18. ;
  19. ;
  20.         public    sl_strlen
  21. ;
  22. sl_strlen    proc    far
  23.         push    ax
  24.         pushf
  25.         push    si
  26.         push    di
  27. ;
  28.         cld
  29.         mov    al, 0
  30.         mov    cx, 0ffffh
  31.     repne    scasb
  32.         neg    cx
  33.         dec    cx
  34.         dec    cx
  35. ;
  36.         pop    di
  37.         pop    si
  38.         popf
  39.         pop    ax
  40.         ret
  41. sl_strlen    endp
  42. ;
  43. ;
  44. stdlib        ends
  45.         end
  46.